/*******************************************************************************
 * Copyright 2011 The fangorn project
 * 
 *        Author: Sumukh Ghodke
 * 
 *        Licensed to the Apache Software Foundation (ASF) under one
 *        or more contributor license agreements.  See the NOTICE file
 *        distributed with this work for additional information
 *        regarding copyright ownership.  The ASF licenses this file
 *        to you under the Apache License, Version 2.0 (the
 *        "License"); you may not use this file except in compliance
 *        with the License.  You may obtain a copy of the License at
 * 
 *          http://www.apache.org/licenses/LICENSE-2.0
 * 
 *        Unless required by applicable law or agreed to in writing,
 *        software distributed under the License is distributed on an
 *        "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 *        KIND, either express or implied.  See the License for the
 *        specific language governing permissions and limitations
 *        under the License.
 ******************************************************************************/
package au.edu.unimelb.csse;

import java.util.ArrayList;
import java.util.List;

public class Corpora {
	private List<Integer> ids;
	private List<String> dirs;
	private List<String> names;
	private List<Integer> sents;
	private List<String> dates;
	private String defaultSelection;
	
	private Corpora() {
		ids = new ArrayList<Integer>();
		dirs = new ArrayList<String>();
		names = new ArrayList<String>();
		sents = new ArrayList<Integer>();
		dates = new ArrayList<String>();
	}
	
	public List<String> corporaDirs() {
		return dirs;
	}
	
	public static final Corpora INSTANCE = new Corpora();
	
	public void addCorpus(int id, String dir, String name, int sents, String date) {
		ids.add(id);
		dirs.add(dir);
		names.add(name);
		this.sents.add(sents);
		dates.add(date);
	}
	
	public String getDir(int pos) {
		return dirs.get(pos);
	}
	
	public String getName(int pos) {
		return names.get(pos);
	}
	
	public Integer getNumberOfSentences(int pos) {
		return sents.get(pos);
	}
	
	public String getDate(int pos) {
		return dates.get(pos);
	}
	
	public void setDefaultSelection(int id) {
		for (int i = 0; i < ids.size(); i++) {
			if (ids.get(i).equals(id)) {
				defaultSelection = dirs.get(i);	
				break;
			}
		}
	}
	
	public String getDefaultCorpus() {
		return defaultSelection;
	}
}
